﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using LanceZhang.Research.BLL;
using LanceZhang.Research.Model;

public partial class UserControl_MyEncouragement : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["pid"] == null)
        {
            TBL_UserModel user = (TBL_UserModel)Session["UM"];
            string id = user.UserID;
            TBL_Honour bookcontrl = new TBL_Honour();
            grdMain.DataSource = bookcontrl.GetList(" ProjectID in (select ProjectID from TBL_ProjectMember where UserID='" + id + "')");
            grdMain.DataBind();
        }
        else
        {
            TBL_Honour hc = new TBL_Honour();
            grdMain.DataSource = hc.GetList(" ProjectID='" + Request.QueryString["pid"] + "'");
            grdMain.DataBind();
        }

    }
    protected void grdMain_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        Response.Redirect("HonourDetail.aspx?id=" + grdMain.DataKeys[Convert.ToInt16(e.CommandArgument)].Value.ToString());
    }
}
